import {take, call, put, fork, cancel} from 'redux-saga/effects';
import AuthManager from '../services/auth'
import * as Actions from '../actions/index'
import * as Types from '../actions/ActionTypes.js'
import * as api from '../services/company';
import {message} from 'antd';
import callServiceApi from './utils';

function* watchCompanyQuery() {
  while (true) {
    yield take(Types.COMPANY_QUERY.REQUEST);
    yield fork(companyQuery);
  }
}

function* companyQuery() {
  yield fork(callServiceApi, Actions.companyQuery, api.queryCompanyByStudentId, {});
}

export default function*() {
  yield [
    fork(watchCompanyQuery),
  ];
}
